#include "ultrasound.h"

/**
 * Configures the ultrasound module
 * @param pinOut the output pin connected to the transmitting end of the sensor
 * @param pinIn the input pin connected to the receiving end of the sensor
 */
void setupUltrasound(int pinOut, int pinIn){
  // TODO: make function more flexible
  // allow user to set all necessary properties throught the arguments
  TCCR1A = _BV(COM1A1) | _BV(WGM11); //fast PWM-mode
  TCCR1B = _BV(WGM12) | _BV(WGM13) | _BV(CS10);//fast PWM-mode en N=1
  ICR1 = 399; // PWMfreq= Fclk/(N.(1+TOP) ICR1=TOP 16.000.000/(1.(1+399)) = 40kHz
  pinMode(pinOut, OUTPUT); // pin 9 als output
}

void sendUltrasound(int len){
  // add code
}

void readUltrasound(int pinIn){
  // add code
}

